/**
 * @author Wang Hai Long  [whailong2010@gmail.com]
 * @date Sep 27, 2014 7:45:27 PM
 */
package com.surent.model.dbmodel;

import com.avos.avoscloud.AVClassName;
import com.avos.avoscloud.AVGeoPoint;
import com.avos.avoscloud.AVObject;

/**
 * @author Wang Hai Long [whailong2010@gmail.com]
 * @date Sep 27, 2014 7:45:27 PM
 */
@AVClassName("House")
public class House extends AVObject {
	// 房源标题
	private String title;
	// 查看次数
	private int countSee;
	// 租金价格
	private int price;
	// 支付类型
	private String payType;
	// 出租类型
	private String rentType;
	// 户型
	private String houseLayout;
	// 面积
	private int area;
	// 房屋所在楼层
	private int storey;
	// 楼的总楼层
	private int storeyTotal;
	// 朝向
	private String orientation;
	// 装潢
	private String decorateLevel;
	// 详细信息
	private String detailInfo;
	// 配置
	private String facility;

	// 所在区域
	private String district;
	// 小区名
	private String communityName;
	// 坐标
	private AVGeoPoint location;

	// 联系人名字
	private String linkName;
	// 联系人电话
	private String linkPhoneNum;

	// 来源
	private String from;

	// 房屋发布者
	private User owner;

	/**
	 * 
	 */
	public House() {
		super();
	}

	/**
	 * @param title
	 * @param countSee
	 * @param price
	 * @param payType
	 * @param houseLayout
	 * @param area
	 * @param storey
	 * @param storeyTotal
	 * @param orientation
	 * @param decorateLevel
	 * @param detailInfo
	 * @param communityName
	 * @param location
	 * @param linkName
	 * @param linkPhoneNum
	 */
	public void ininData(String title, int price, String houseLayout, int area, int storey, int storeyTotal,
			String detailInfo, String facility, String rentType, String decorateLevel, String orientation,
			String payType, String district, String communityName, AVGeoPoint location, String linkName,
			String linkPhoneNum, String from, User owner) {

		this.setTitle(title);
		this.setPrice(price);
		this.setHouseLayout(houseLayout);
		this.setArea(area);

		this.setStorey(storey);
		this.setStoreyTotal(storeyTotal);

		this.setPayType(payType);
		this.setRentType(rentType);

		this.setDetailInfo(detailInfo);
		this.setFacility(facility);
		this.setDecorateLevel(decorateLevel);
		this.setOrientation(orientation);

		this.setDistrict(district);
		this.setCommunityName(communityName);
		this.setLocation(location);
		this.setLinkName(linkName);
		this.setLinkPhoneNum(linkPhoneNum);

		this.setFrom(from);

		this.setOwner(owner);
	}

	public String getRentType() {
		return this.getString("rentType");
	}

	public void setRentType(String rentType) {
		this.put("rentType", rentType);
	}

	public String getPayType() {
		return this.getString("payType");
	}

	public String getOrientation() {
		return this.getString("orientation");
	}

	public String getDecorateLevel() {
		return this.getString("decorateLevel");
	}

	public String getFacility() {
		return this.getString("facility");
	}

	public void setPayType(String payType) {
		this.put("payType", payType);
	}

	public void setOrientation(String orientation) {
		this.put("orientation", orientation);
	}

	public void setDecorateLevel(String decorateLevel) {
		this.put("decorateLevel", decorateLevel);
	}

	public void setFacility(String facility) {
		this.put("facility", facility);
	}

	public String getDistrict() {
		return this.getString("district");
	}

	public void setDistrict(String district) {
		this.put("district", district);
	}

	public User getOwner() {
		try {
			return this.getAVObject("owner", User.class);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	public void setOwner(User owner) {
		this.put("owner", owner);
	}

	public String getTitle() {
		return this.getString("title");
	}

	public void setTitle(String title) {
		this.put("title", title);
	}

	public int getCountSee() {
		return this.getInt("countSee");
	}

	public void takeCountSee() {
		this.increment("countSee", 1);
	}

	public int getPrice() {
		return this.getInt("price");
	}

	public void setPrice(int price) {
		this.put("price", price);
	}

	public String getHouseLayout() {
		return this.getString("houseLayout");
	}

	public void setHouseLayout(String houseLayout) {
		this.put("houseLayout", houseLayout);
	}

	public int getArea() {
		return this.getInt("area");
	}

	public void setArea(int area) {
		this.put("area", area);
	}

	public int getStorey() {
		return this.getInt("storey");
	}

	public void setStorey(int storey) {
		this.put("storey", storey);
	}

	public int getStoreyTotal() {
		return this.getInt("storeyTotal");
	}

	public void setStoreyTotal(int storeyTotal) {
		this.put("storeyTotal", storeyTotal);
	}

	public String getDetailInfo() {
		return this.getString("detailInfo");
	}

	public void setDetailInfo(String detailInfo) {
		this.put("detailInfo", detailInfo);
	}

	public String getCommunityName() {
		return this.getString("communityName");
	}

	public void setCommunityName(String communityName) {
		this.put("communityName", communityName);
	}

	public AVGeoPoint getLocation() {
		return this.getAVGeoPoint("location");
	}

	public void setLocation(AVGeoPoint location) {
		this.put("location", location);
	}

	public String getLinkName() {
		return this.getString("linkName");
	}

	public void setLinkName(String linkName) {
		this.put("linkName", linkName);
	}

	public String getLinkPhoneNum() {
		return this.getString("linkPhoneNum");
	}

	public void setLinkPhoneNum(String linkPhoneNum) {
		this.put("linkPhoneNum", linkPhoneNum);
	}

	public String getFrom() {
		return this.getString("from");
	}

	public void setFrom(String from) {
		this.put("from", from);
	}
}
